//package com.shop.servlet.handler;
//
//
//import com.alibaba.fastjson2.JSON;
//import org.apache.tomcat.util.net.openssl.ciphers.Authentication;
//import org.springframework.http.HttpStatus;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.io.PrintWriter;
//import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
///**
// * 登出成功处理器
// * 处理登出成功后的逻辑
// */
//@Component
//public class LogoutSuccessPointHandler implements LogoutSuccessHandler {
//
//    @Override
//    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, ServletException {
//        // 清除上下文
//        SecurityContextHolder.clearContext();
//
//        response.setStatus(HttpStatus.OK.value());
//        response.setContentType("application.yml/json");
//        response.setCharacterEncoding("utf-8");
//
//        PrintWriter writer = response.getWriter();
//        writer.write(JSON.toJSONString("登出成功"));
//        writer.flush();
//        writer.close();
//    }
//}
